package com.ruoyi.web.nywjz.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.web.nywjz.domain.ElectricBox;
import com.ruoyi.web.nywjz.mapper.ElectricBoxMapper;
import com.ruoyi.web.nywjz.service.IElectricBoxService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 电箱状态Service业务层处理
 *
 * @author ruoyi
 * @date 2025-09-19
 */
@Service
public class ElectricBoxServiceImpl implements IElectricBoxService
{
    @Autowired
    private ElectricBoxMapper electricBoxMapper;

    /**
     * 查询电箱状态
     *
     * @param id 电箱状态主键
     * @return 电箱状态
     */
    @Override
    public ElectricBox selectElectricBoxById(Long id)
    {
        return electricBoxMapper.selectElectricBoxById(id);
    }

    /**
     * 查询电箱状态列表
     *
     * @param electricBox 电箱状态
     * @return 电箱状态
     */
    @Override
    public List<ElectricBox> selectElectricBoxList(ElectricBox electricBox)
    {
        return electricBoxMapper.selectElectricBoxList(electricBox);
    }

    /**
     * 新增电箱状态
     *
     * @param electricBox 电箱状态
     * @return 结果
     */
    @Override
    public int insertElectricBox(ElectricBox electricBox)
    {
        electricBox.setCreateTime(DateUtils.getNowDate());
        return electricBoxMapper.insertElectricBox(electricBox);
    }

    /**
     * 修改电箱状态
     *
     * @param electricBox 电箱状态
     * @return 结果
     */
    @Override
    public int updateElectricBox(ElectricBox electricBox)
    {
        electricBox.setUpdateTime(DateUtils.getNowDate());
        return electricBoxMapper.updateElectricBox(electricBox);
    }

    /**
     * 批量删除电箱状态
     *
     * @param ids 需要删除的电箱状态主键
     * @return 结果
     */
    @Override
    public int deleteElectricBoxByIds(Long[] ids)
    {
        return electricBoxMapper.deleteElectricBoxByIds(ids);
    }

    /**
     * 删除电箱状态信息
     *
     * @param id 电箱状态主键
     * @return 结果
     */
    @Override
    public int deleteElectricBoxById(Long id)
    {
        return electricBoxMapper.deleteElectricBoxById(id);
    }
}
